import Vue from 'vue'
import Router from 'vue-router'
import List from '@/components/shop/List'
import Home from '@/components/shop/Home'
import Product from '@/components/shop/Product'
import Shopcar from '@/components/shop/Shopcar'
import Mine from '@/components/shop/Mine'
import Login from '@/components/user/Login'
import Register from '@/components/user/Register'
import Details from '@/components/shop/Details'
import Search from '@/components/shop/Search'
Vue.use(Router)

export default new Router({
  routes: [
    {//通用样式
      path: '/',
      component:List,
      children:[
        {//默认
         path: '',
         redirect:"home",
       },
       {//主页
         path: 'home',
         component: Home,
       },
       {//产品页
         path: 'product',
         component: Product,
       },
       {//购物车
         path: 'shopcar',
         component: Shopcar,
       },
       {//我的
         path: 'mine',
         component: Mine,
       },
      ]
    },
    {path:'/login',component:Login},//登录
    {path:'/register',component:Register},//注册
    {path:'/details',component:Details},//商品详情
    {path:'/search',component:Search},//搜索
  ]
})
